from __future__ import annotations

from numbers import Number
from typing import Union, Dict, List, Literal
from modules.amis.component.base import FormItemSchema, OptionType, SchemaNode, FormMode, LabelAlign, NumberAndStr, \
    BaseSchema, MixedDict, NoneSchema, SelectMode, MixedOption, Action, FormBaseControlSchema, FormOptionsControl, \
    SchemaTpl, PopOver, SchemaPopOver, ColorFormat, PresetColor, SchemaApi, Renderable, SchemaClassName, ComboCondition, \
    FormHorizontal, TabsStyle, Icon, VariableItem, FuncGroup, SchemaIcon, Level, Size, BorderMode, PlainObject, \
    Placement, Badge, T, ValidationConfig, Limit, FormBaseControl, SchemaCollection, SchemaTooltip, OverflowConfig, \
    Option


class Static(FormBaseControlSchema):
    def __init__(
            self,
            tpl: SchemaTpl = None,
            text: SchemaTpl = None,
            popOver: SchemaPopOver = None,
            quickEdit: str = None,
            copyable: str = None,
            borderMode: Literal["full", "half", "none"] = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "static"
        # 内容模板， 支持 HTML
        self.tpl: SchemaTpl = tpl
        # 内容模板，不支持 HTML
        self.text: SchemaTpl = text
        # 配置查看详情功能
        self.popOver: SchemaPopOver = popOver
        # 配置快速编辑功能
        self.quickEdit: str = quickEdit
        # 配置点击复制功能
        self.copyable: str = copyable
        # 边框模式，默认是无边框的
        self.borderMode: Literal["full", "half", "none"] = borderMode

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputText(FormBaseControlSchema):
    """
        文本框
    """

    def __init__(
            self,
            name: str = None,
            label: MixedDict = None,
            placeholder: str = None,
            value: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-text"
        self.name: str = name
        self.label: str = label
        self.placeholder: str = placeholder
        self.value: str = value
        self.clearable: bool = None
        self.borderMode: str = None
        self.options: MixedOption = None
        self.multiple: bool = None
        self.delimiter: str = None
        self.prefix: str = None
        self.suffix: str = None
        self.labelField: str = None
        self.valueField: str = None
        self.joinValues: bool = None
        self.extractValue: bool = None
        self.inputControlClassName: str = None
        self.nativeInputClassName: str = None
        self.validateApi: str = None

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputEmail(InputText):
    """
        邮箱地址框
    """

    def __init__(
            self,
            name: str = None,
            label: str = None,
            placeholder: str = None,
            **kwargs,
    ):
        super().__init__(name=name, label=label)
        self.type: str = "input-email"
        self.placeholder: str = placeholder
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputPassword(InputText):
    """
        密码框
    """

    def __init__(
            self,
            name: str = None,
            label: MixedDict = None,
            placeholder: str = None,
            **kwargs,
    ):
        super().__init__(name=name, label=label)
        self.type: str = "input-password"
        self.placeholder: str = placeholder
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputUrl(InputText):
    """
        URL框
    """

    def __init__(
            self,
            name: str = None,
            label: str = None,
            placeholder: str = None,
            **kwargs,
    ):
        super().__init__(name=name, label=label)
        self.type: str = "input-url"
        self.placeholder: str = placeholder
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Select(FormItemSchema):
    def __init__(
            self,
            name: str = None,
            label: str = None,
            options: MixedOption = None,
            source: str = None,
            menuTpl: str = None,
            placeholder: str = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,
            checkAll: bool = None,
            checkAllLabel: str = None,
            checkAllBySearch: bool = None,
            defaultCheckAll: bool = None,
            multiple: bool = None,
            searchable: bool = None,
            clearable: bool = None,
            selectMode: SelectMode = None,
            columns: List[Dict] = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "select"
        self.name = name
        self.label = label
        self.options = options
        self.menuTpl = menuTpl
        self.source = source
        self.delimiter = delimiter
        self.labelField = labelField
        self.valueField = valueField
        self.joinValues = joinValues
        self.extractValue = extractValue
        self.checkAll = checkAll
        self.checkAllLabel: str = checkAllLabel
        self.checkAllBySearch = checkAllBySearch
        self.defaultCheckAll = defaultCheckAll
        self.multiple = multiple
        self.searchable = searchable
        self.clearable = clearable
        self.selectMode: SelectMode = selectMode
        self.columns = columns
        self.placeholder: str = placeholder
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputDate(FormBaseControlSchema):
    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            minDate: str = None,
            maxDate: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-date"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect
        # 限制最小日期
        self.minDate: str = minDate
        # 限制最大日期
        self.maxDate: str = maxDate

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputDateTime(FormBaseControlSchema):
    """
    日期时间选择控件
    """

    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            minDate: str = None,
            maxDate: str = None,
            timeConstraints: object = None,
            isEndDate: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-datetime"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect
        # 限制最小日期
        self.minDate: str = minDate
        # 限制最大日期
        self.maxDate: str = maxDate
        # 时间输入范围限制
        self.timeConstraints: object = timeConstraints
        # 是否为结束时间，如果是，那么会自动加上 23:59:59
        self.isEndDate: bool = isEndDate

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputTime(FormBaseControlSchema):
    """
    时间选择控件
    """

    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            timeConstraints: object = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-time"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect
        # 时间输入范围限制
        self.timeConstraints: object = timeConstraints

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputMonth(FormBaseControlSchema):
    """
    月份选择控件
    """

    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-month"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputQuarter(FormBaseControlSchema):
    """
    季度选择控件
    """

    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-quarter"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputQuarterRange(FormBaseControlSchema):
    """
    QuarterRange 季度范围控件
    """

    def __init__(
            self,
            delimiter: str = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            joinValues: bool = None,
            borderMode: BorderMode = None,
            value: str = None,
            minDate: str = None,
            maxDate: str = None,
            minDuration: str = None,
            maxDuration: str = None,
            embed: bool = None,
            shortcuts: List[MixedDict] = None,
            startPlaceholder: str = None,
            endPlaceholder: str = None,
            animation: bool = None,
            transform: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-quarter-range"
        # 分割符, 因为有两个值，开始时间和结束时间，所以要有连接符。默认为英文逗号。
        self.delimiter: str = delimiter
        # 默认 `X` 即时间戳格式，用来提交的时间格式。更多格式类型请参考 moment.
        self.format: str = format
        # 用来提交的时间格式。更多格式类型请参考 moment.（新：同format）
        self.valueFormat: str = valueFormat
        # 默认 `YYYY-MM-DD` 用来配置显示的时间格式。
        self.inputFormat: str = inputFormat
        # 用来配置显示的时间格式（新：同inputFormat）
        self.displayFormat: str = displayFormat
        # 开启后将选中的选项 value 的值用连接符拼接起来，作为当前表单项的值。如： `value1,value2` 否则为 `[value1, value2]`
        self.joinValues: bool = joinValues
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 这里面 value 需要特殊说明一下，因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.value: str = value
        # 日期范围快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 最小日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.minDate: str = minDate
        # 最大日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.maxDate: str = maxDate
        # 最小跨度，比如 2days
        self.minDuration: str = minDuration
        # 最大跨度，比如 2days
        self.maxDuration: str = maxDuration
        # 开启后变成非弹出模式，即内联模式。
        self.embed: bool = embed
        # 日期范围开始时间-占位符
        self.startPlaceholder: str = startPlaceholder
        # 日期范围结束时间-占位符
        self.endPlaceholder: str = endPlaceholder
        # 是否启用游标动画，默认开启
        self.animation: bool = animation
        # 日期数据处理函数，用来处理选择日期之后的的值
        #    * (value: moment.Moment, config: {type: 'start' | 'end'; originValue: moment.Moment, timeFormat: string}, props: any, data: any, moment: moment) => moment.Moment;
        self.transform: str = transform
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputYear(FormBaseControlSchema):
    """
    年份选择控件
    """

    def __init__(
            self,
            clearable: bool = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            utc: bool = None,
            emebed: bool = None,
            borderMode: BorderMode = None,
            shortcuts: List[MixedDict] = None,
            disabledDate: str = None,
            closeOnSelect: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-year"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 日期存储格式
        self.format: str = format
        # 替代format
        self.valueFormat: str = valueFormat
        # 日期展示格式
        self.inputFormat: str = inputFormat
        # 日期展示格式(新：替代inputFormat)
        self.displayFormat: str = displayFormat
        # 设定是否存储 utc 时间。
        self.utc: bool = utc
        # 是否为内联模式？
        self.emebed: bool = emebed
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 日期快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 字符串函数，用来决定是否禁用某个日期。
        self.disabledDate: str = disabledDate
        # 点选日期后是否关闭弹窗
        self.closeOnSelect: bool = closeOnSelect

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputYearRange(FormBaseControlSchema):
    """
    YearRange 年份范围控件
    """

    def __init__(
            self,
            delimiter: str = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            joinValues: bool = None,
            borderMode: BorderMode = None,
            value: str = None,
            minDate: str = None,
            maxDate: str = None,
            minDuration: str = None,
            maxDuration: str = None,
            embed: bool = None,
            shortcuts: List[MixedDict] = None,
            startPlaceholder: str = None,
            endPlaceholder: str = None,
            animation: bool = None,
            transform: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-quarter-range"
        # 分割符, 因为有两个值，开始时间和结束时间，所以要有连接符。默认为英文逗号。
        self.delimiter: str = delimiter
        # 默认 `X` 即时间戳格式，用来提交的时间格式。更多格式类型请参考 moment.
        self.format: str = format
        # 用来提交的时间格式。更多格式类型请参考 moment.（新：同format）
        self.valueFormat: str = valueFormat
        # 默认 `YYYY-MM-DD` 用来配置显示的时间格式。
        self.inputFormat: str = inputFormat
        # 用来配置显示的时间格式（新：同inputFormat）
        self.displayFormat: str = displayFormat
        # 开启后将选中的选项 value 的值用连接符拼接起来，作为当前表单项的值。如： `value1,value2` 否则为 `[value1, value2]`
        self.joinValues: bool = joinValues
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 这里面 value 需要特殊说明一下，因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.value: str = value
        # 日期范围快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 最小日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.minDate: str = minDate
        # 最大日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.maxDate: str = maxDate
        # 最小跨度，比如 2days
        self.minDuration: str = minDuration
        # 最大跨度，比如 2days
        self.maxDuration: str = maxDuration
        # 开启后变成非弹出模式，即内联模式。
        self.embed: bool = embed
        # 日期范围开始时间-占位符
        self.startPlaceholder: str = startPlaceholder
        # 日期范围结束时间-占位符
        self.endPlaceholder: str = endPlaceholder
        # 是否启用游标动画，默认开启
        self.animation: bool = animation
        # 日期数据处理函数，用来处理选择日期之后的的值
        #    * (value: moment.Moment, config: {type: 'start' | 'end'; originValue: moment.Moment, timeFormat: string}, props: any, data: any, moment: moment) => moment.Moment;
        self.transform: str = transform
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputDateRange(FormBaseControlSchema):
    def __init__(
            self,
            delimiter: str = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            joinValues: bool = None,
            borderMode: BorderMode = None,
            value: str = None,
            minDate: str = None,
            maxDate: str = None,
            minDuration: str = None,
            maxDuration: str = None,
            embed: bool = None,
            shortcuts: List[MixedDict] = None,
            startPlaceholder: str = None,
            endPlaceholder: str = None,
            animation: bool = None,
            transform: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-date-range"
        # 分割符, 因为有两个值，开始时间和结束时间，所以要有连接符。默认为英文逗号。
        self.delimiter: str = delimiter
        # 默认 `X` 即时间戳格式，用来提交的时间格式。更多格式类型请参考 moment.
        self.format: str = format
        # 用来提交的时间格式。更多格式类型请参考 moment.（新：同format）
        self.valueFormat: str = valueFormat
        # 默认 `YYYY-MM-DD` 用来配置显示的时间格式。
        self.inputFormat: str = inputFormat
        # 用来配置显示的时间格式（新：同inputFormat）
        self.displayFormat: str = displayFormat
        # 开启后将选中的选项 value 的值用连接符拼接起来，作为当前表单项的值。如： `value1,value2` 否则为 `[value1, value2]`
        self.joinValues: bool = joinValues
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 这里面 value 需要特殊说明一下，因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.value: str = value
        # 日期范围快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 最小日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.minDate: str = minDate
        # 最大日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.maxDate: str = maxDate
        # 最小跨度，比如 2days
        self.minDuration: str = minDuration
        # 最大跨度，比如 2days
        self.maxDuration: str = maxDuration
        # 开启后变成非弹出模式，即内联模式。
        self.embed: bool = embed
        # 日期范围开始时间-占位符
        self.startPlaceholder: str = startPlaceholder
        # 日期范围结束时间-占位符
        self.endPlaceholder: str = endPlaceholder
        # 是否启用游标动画，默认开启
        self.animation: bool = animation
        # 日期数据处理函数，用来处理选择日期之后的的值
        #    * (value: moment.Moment, config: {type: 'start' | 'end'; originValue: moment.Moment, timeFormat: string}, props: any, data: any, moment: moment) => moment.Moment;
        self.transform: str = transform
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputDateTimeRange(FormBaseControlSchema):
    def __init__(
            self,
            delimiter: str = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            joinValues: bool = None,
            borderMode: BorderMode = None,
            value: str = None,
            minDate: str = None,
            maxDate: str = None,
            minDuration: str = None,
            maxDuration: str = None,
            embed: bool = None,
            shortcuts: List[MixedDict] = None,
            startPlaceholder: str = None,
            endPlaceholder: str = None,
            animation: bool = None,
            transform: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-datetime-range"
        # 分割符, 因为有两个值，开始时间和结束时间，所以要有连接符。默认为英文逗号。
        self.delimiter: str = delimiter
        # 默认 `X` 即时间戳格式，用来提交的时间格式。更多格式类型请参考 moment.
        self.format: str = format
        # 用来提交的时间格式。更多格式类型请参考 moment.（新：同format）
        self.valueFormat: str = valueFormat
        # 默认 `YYYY-MM-DD` 用来配置显示的时间格式。
        self.inputFormat: str = inputFormat
        # 用来配置显示的时间格式（新：同inputFormat）
        self.displayFormat: str = displayFormat
        # 开启后将选中的选项 value 的值用连接符拼接起来，作为当前表单项的值。如： `value1,value2` 否则为 `[value1, value2]`
        self.joinValues: bool = joinValues
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 这里面 value 需要特殊说明一下，因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.value: str = value
        # 日期范围快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 最小日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.minDate: str = minDate
        # 最大日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.maxDate: str = maxDate
        # 最小跨度，比如 2days
        self.minDuration: str = minDuration
        # 最大跨度，比如 2days
        self.maxDuration: str = maxDuration
        # 开启后变成非弹出模式，即内联模式。
        self.embed: bool = embed
        # 日期范围开始时间-占位符
        self.startPlaceholder: str = startPlaceholder
        # 日期范围结束时间-占位符
        self.endPlaceholder: str = endPlaceholder
        # 是否启用游标动画，默认开启
        self.animation: bool = animation
        # 日期数据处理函数，用来处理选择日期之后的的值
        #    * (value: moment.Moment, config: {type: 'start' | 'end'; originValue: moment.Moment, timeFormat: string}, props: any, data: any, moment: moment) => moment.Moment;
        self.transform: str = transform
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputTimeRange(FormBaseControlSchema):
    def __init__(
            self,
            delimiter: str = None,
            format: str = None,
            valueFormat: str = None,
            inputFormat: str = None,
            displayFormat: str = None,
            joinValues: bool = None,
            borderMode: BorderMode = None,
            value: str = None,
            minDate: str = None,
            maxDate: str = None,
            minDuration: str = None,
            maxDuration: str = None,
            embed: bool = None,
            shortcuts: List[MixedDict] = None,
            startPlaceholder: str = None,
            endPlaceholder: str = None,
            animation: bool = None,
            transform: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "input-time-range"
        # 分割符, 因为有两个值，开始时间和结束时间，所以要有连接符。默认为英文逗号。
        self.delimiter: str = delimiter
        # 默认 `X` 即时间戳格式，用来提交的时间格式。更多格式类型请参考 moment.
        self.format: str = format
        # 用来提交的时间格式。更多格式类型请参考 moment.（新：同format）
        self.valueFormat: str = valueFormat
        # 默认 `YYYY-MM-DD` 用来配置显示的时间格式。
        self.inputFormat: str = inputFormat
        # 用来配置显示的时间格式（新：同inputFormat）
        self.displayFormat: str = displayFormat
        # 开启后将选中的选项 value 的值用连接符拼接起来，作为当前表单项的值。如： `value1,value2` 否则为 `[value1, value2]`
        self.joinValues: bool = joinValues
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 这里面 value 需要特殊说明一下，因为支持相对值。* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.value: str = value
        # 日期范围快捷键
        self.shortcuts: List[MixedDict] = shortcuts
        # 最小日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.minDate: str = minDate
        # 最大日期限制，支持变量 $xxx 来取值，或者用相对值如：* `-2mins` 2分钟前\n * `+2days` 2天后\n* `-10week` 十周前\n可用单位： `min`、`hour`、`day`、`week`、`month`、`year`。所有单位支持复数形式。
        self.maxDate: str = maxDate
        # 最小跨度，比如 2days
        self.minDuration: str = minDuration
        # 最大跨度，比如 2days
        self.maxDuration: str = maxDuration
        # 开启后变成非弹出模式，即内联模式。
        self.embed: bool = embed
        # 日期范围开始时间-占位符
        self.startPlaceholder: str = startPlaceholder
        # 日期范围结束时间-占位符
        self.endPlaceholder: str = endPlaceholder
        # 是否启用游标动画，默认开启
        self.animation: bool = animation
        # 日期数据处理函数，用来处理选择日期之后的的值
        #    * (value: moment.Moment, config: {type: 'start' | 'end'; originValue: moment.Moment, timeFormat: string}, props: any, data: any, moment: moment) => moment.Moment;
        self.transform: str = transform
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Form(BaseSchema):
    def __init__(
            self,
            name: str = None,
            label: str = "",
            title: SchemaNode = "",
            api: str = None,
            initApi: str = None,
            mode: FormMode = None,
            horizontal: Dict = None,
            body: SchemaNode = None,
            labelAlign: LabelAlign = None,
            labelWidth: NumberAndStr = None,
            submitText: str = None,
            className: str = None,
            actions: List[Action] = None,
            target: str = None,
            redirect: str = None,
            reload: str = None,
            autoFocus: bool = None,
            rules: Dict = None,
            wrapWithPanel: bool = None,
            debug: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type = "form"
        self.name: str = name
        self.label: str = label
        self.title: SchemaNode = title
        self.api: str = api
        self.initApi: str = initApi
        self.mode: FormMode = mode
        self.horizontal: Dict = horizontal
        self.labelAlign: LabelAlign = labelAlign
        self.labelWidth: NumberAndStr = labelWidth
        self.submitText: str = submitText
        self.className: str = className
        self.body: SchemaNode = body
        self.target: str = target
        self.redirect: str = redirect
        self.reload: str = reload
        self.autoFocus: bool = autoFocus
        self.rules: Dict = rules
        self.wrapWithPanel: bool = wrapWithPanel
        self.actions: List[Action] = actions
        self.debug: bool = debug
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Checkbox(FormBaseControlSchema):
    def __init__(self,
                 trueValue: Union[str, Number, bool] = None,
                 falseValue: Union[str, Number, bool] = None,
                 option: str = None,
                 badge: str = None,
                 partial: bool = None,
                 checked: bool = None,
                 **kwargs,
                 ):
        super().__init__()
        self.type = "checkbox"
        # 选项说明
        self.option = option
        # 角标
        self.badge: str = badge
        # 勾选值
        self.trueValue: Union[str, Number, bool] = trueValue
        # 未勾选值
        self.falseValue: Union[str, Number, bool] = falseValue
        self.partial: bool = partial
        self.optionType: OptionType = OptionType.none
        self.checked: bool = checked
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Checkboxes(FormBaseControlSchema, FormOptionsControl):
    def __init__(self,
                 checkAll: bool = None,
                 defaultCheckAll: bool = None,
                 checkAllText: str = None,
                 columnsCount: Union[Number, List[Number]] = None,
                 menuTpl: str = None,
                 **kwargs,
                 ):
        super().__init__()
        self.type = "checkboxes"
        # 是否开启全选功能
        self.checkAll: bool = checkAll
        # 是否默认全选
        self.defaultCheckAll: bool = defaultCheckAll
        # 全选/不选文案
        self.checkAllText: str = checkAllText
        # 每行显示多少个
        self.columnsCount: Union[Number, List[Number]] = columnsCount
        # 自定义选项展示
        self.menuTpl: str = menuTpl

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputCity(FormBaseControlSchema):
    def __init__(self,
                 extractValue: bool = None,
                 joinValues: bool = None,
                 delimiter: str = None,
                 allowCity: bool = None,
                 allowDistrict: bool = None,
                 allowStreet: bool = None,
                 searchable: bool = None,
                 itemClassName: str = None,
                 **kwargs,
                 ):
        super().__init__()
        self.type = "input-city"
        # 开启后只会存城市的 code 信息
        self.extractValue: bool = extractValue
        # 是否将各个信息拼接成字符串。
        self.joinValues: bool = joinValues
        # 拼接的符号是啥？
        self.delimiter: str = delimiter
        # 允许选择城市？
        self.allowCity: bool = allowCity
        # 允许选择地区？
        self.allowDistrict: bool = allowDistrict
        # 允许选择街道？
        self.allowStreet: bool = allowStreet
        # 是否显示搜索框
        self.searchable: bool = searchable
        # 下拉框className
        self.itemClassName: str = itemClassName

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputColor(FormBaseControlSchema):
    def __init__(self,
                 clearable: bool = None,
                 closeOnSelect: bool = None,
                 format: ColorFormat = None,
                 presetColors: List[PresetColor] = None,
                 allowCustomColor: bool = None,
                 resetValue: str = None,
                 **kwargs,
                 ):
        super().__init__()
        self.type = "input-color"
        # 是否显示清除按钮
        self.clearable: bool = clearable
        # 选中颜色后是否关闭弹出层。
        self.closeOnSelect: bool = closeOnSelect
        # 颜色格式
        self.format: ColorFormat = format
        # 预设颜色，用户可以直接从预设中选。
        if presetColors is None:
            self.presetColors: List[PresetColor] = [
                {
                    "color": "#d4380d",
                    "title": "熔岩红"
                },
                {
                    "color": "#ffa940",
                    "title": "金桔橙"
                },
                {
                    "color": "#ffec3d",
                    "title": "土豪金"
                },
                {
                    "color": "#73d13d",
                    "title": "苹果绿"
                },
                {
                    "color": "#73E3EC",
                    "title": "蒂芙尼青"
                },
                {
                    "color": "#2f54eb",
                    "title": "冰川蓝"
                },
                {
                    "color": "#9254de",
                    "title": "薰衣草紫"
                },
                {
                    "color": "#ffc0cb",
                    "title": "樱花粉"
                }
            ]
        else:
            self.presetColors: List[PresetColor] = presetColors
        # 是否允许用户输入颜色。
        self.allowCustomColor: bool = allowCustomColor
        # 清除后，表单项值调整成该值
        self.resetValue: str = resetValue

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Combo(FormBaseControlSchema):
    """
    Combo 组合

    用于将多个表单项组合到一起，实现深层结构的数据编辑。

    Args:
        formClassName:	string		单组表单项的类名
        items:	Array<表单项>		组合展示的表单项
        items[x].columnClassName:	string		列的类名，可以用它配置列宽度。默认平均分配。
        items[x].unique:	boolean		设置当前列值是否唯一，即不允许重复选择。
        noBorder:	boolean	false	单组表单项是否显示边框
        scaffold:	object	{}	单组表单项初始值
        multiple:	boolean	false	是否多选
        multiLine:	boolean	false	默认是横着展示一排，设置以后竖着展示
        minLength:	number		最少添加的条数，2.4.1 版本后支持变量
        maxLength:	number		最多添加的条数，2.4.1 版本后支持变量
        flat:	boolean	false	是否将结果扁平化(去掉 name),只有当 items 的 length 为 1 且 multiple 为 true 的时候才有效。
        joinValues:	boolean	true	默认为 true 当扁平化开启的时候，是否用分隔符的形式发送给后端，否则采用 array 的方式。
        delimiter:	string	false	当扁平化开启并且 joinValues 为 true 时，用什么分隔符。
        addable:	boolean	false	是否可新增
        addattop:	boolean	false	在顶部添加
        removable:	boolean	false	是否可删除
        deleteApi:	API		如果配置了，则删除前会发送一个 api，请求成功才完成删除
        deleteConfirmText:	string	"确认要删除？"	当配置 deleteApi 才生效！删除时用来做用户确认
        draggable:	boolean	false	是否可以拖动排序, 需要注意的是当启用拖动排序的时候，会多一个$id 字段
        draggableTip:	string		可拖拽的提示文字
        subFormMode:	string	"normal"	可选normal、horizontal、inline
        subFormHorizontal:	Object	{"left":2, "right":10, justify: false}	当 subFormMode 为 horizontal 时有用，用来控制 label 的展示占比
        placeholder:	string	``	没有成员时显示。
        canAccessSuperData:	boolean	false	指定是否可以自动获取上层的数据并映射到表单项上
        conditions:	object		数组的形式包含所有条件的渲染类型，单个数组内的test 为判断条件，数组内的items为符合该条件后渲染的schema
        typeSwitchable:	boolean	false	是否可切换条件，配合conditions使用
        strictMode:	boolean	true	默认为严格模式，设置为 false 时，当其他表单项更新是，里面的表单项也可以及时获取，否则不会。
        syncFields:	Array<string>	[]	配置同步字段。只有 strictMode 为 false 时有效。如果 Combo 层级比较深，底层的获取外层的数据可能不同步。但是给 combo 配置这个属性就能同步下来。输入格式：["os"]
        nullable:	boolean	false	允许为空，如果子表单项里面配置验证器，且又是单条模式。可以允许用户选择清空（不填）。
        itemClassName:	string		单组 CSS 类
        itemsWrapperClassName:	string		组合区域 CSS 类
        deleteBtn:	Button or string	自定义删除按钮	只有当removable为 true 时有效; 如果为string则为按钮的文本；如果为Button则根据配置渲染删除按钮。
        addBtn:	Button	自定义新增按钮	可新增自定义配置渲染新增按钮，在tabsMode: true下不生效。
        addButtonClassName:	string		新增按钮 CSS 类名
        addButtonText:	string	"新增"	新增按钮文字
    """

    def __init__(self,
                 scaffold: object = None,
                 noBorder: bool = None,
                 deleteConfirmText: str = None,
                 deleteApi: SchemaApi = None,
                 typeSwitchable: bool = None,
                 conditions: List[ComboCondition] = None,
                 formClassName: SchemaClassName = None,
                 addButtonClassName: SchemaClassName = None,
                 addButtonText: str = None,
                 addable: bool = None,
                 addattop: bool = None,
                 items: List[BaseSchema] = None,
                 draggable: bool = None,
                 draggableTip: str = None,
                 flat: bool = None,
                 maxLength: NumberAndStr = None,
                 minLength: NumberAndStr = None,
                 multiLine: bool = None,
                 multiple: bool = None,
                 removable: bool = None,
                 subFormMode: FormMode = None,
                 subFormHorizontal: FormHorizontal = None,
                 placeholder: str = None,
                 canAccessSuperData: bool = None,
                 tabsMode: bool = None,
                 tabsStyle: TabsStyle = None,
                 tabsLabelTpl: SchemaTpl = None,
                 lazyLoad: bool = None,
                 strictMode: bool = None,
                 syncFields: List[str] = None,
                 nullable: bool = None,
                 messages: Dict[str, str] = None,
                 updatePristineAfterStoreDataReInit: bool = None,
                 **kwargs,
                 ):
        super().__init__()
        self.type = "combo"
        # 单组表单项初始值。默认为 `{}`
        self.scaffold: object = scaffold
        # 是否含有边框
        self.noBorder: bool = noBorder
        # 确认删除时的提示
        self.deleteConfirmText: str = deleteConfirmText
        # 删除时调用的api
        self.deleteApi: SchemaApi = deleteApi
        # 是否可切换条件，配合`conditions`使用
        self.typeSwitchable: bool = typeSwitchable
        # 符合某类条件后才渲染的schema
        self.conditions: List[ComboCondition] = conditions
        # 内部单组表单项的类名
        self.formClassName: SchemaClassName = formClassName
        # 新增按钮CSS类名
        self.addButtonClassName: SchemaClassName = addButtonClassName
        # 新增按钮文字
        self.addButtonText: str = addButtonText
        # 是否可新增
        self.addable: bool = addable
        # Add at top
        self.addattop: bool = addattop
        # 数组输入框的子项
        self.items: List[BaseSchema] = items
        # 是否可拖拽排序
        self.draggable: bool = draggable
        # 可拖拽排序的提示信息。
        self.draggableTip: str = draggableTip
        # 是否将结果扁平化(去掉name),只有当controls的length为1且multiple为true的时候才有效
        self.flat: bool = flat
        # 限制最大个数
        self.maxLength: NumberAndStr = maxLength
        # 限制最小个数
        self.minLength: NumberAndStr = minLength
        # 是否多行模式，默认一行展示完
        self.multiLine: bool = multiLine
        # 是否可多选
        self.multiple: bool = multiple
        # 是否可删除
        self.removable: bool = removable
        # 子表单的模式。
        self.subFormMode: FormMode = subFormMode
        # 如果是水平排版，这个属性可以细化水平排版的左右宽度占比。
        self.subFormHorizontal: FormHorizontal = subFormHorizontal
        # 没有成员时显示。
        self.placeholder: str = placeholder
        # 是否可以访问父级数据，正常 combo 已经关联到数组成员，是不能访问父级数据的。
        self.canAccessSuperData: bool = canAccessSuperData
        # 采用 Tabs 展示方式？
        self.tabsMode: bool = tabsMode
        # Tabs 的展示模式。
        self.tabsStyle: TabsStyle = tabsStyle
        #  选项卡标题的生成模板。
        self.tabsLabelTpl: SchemaTpl = tabsLabelTpl
        # 数据比较多，比较卡时，可以试试开启。
        self.lazyLoad: bool = lazyLoad
        # 严格模式，为了性能默认不开的。
        self.strictMode: bool = strictMode
        # 配置同步字段。只有 `strictMode` 为 `false` 时有效。
        #    * 如果 Combo 层级比较深，底层的获取外层的数据可能不同步。
        #    * 但是给 combo 配置这个属性就能同步下来。输入格式：`["os"]`
        self.syncFields: List[str] = syncFields
        # 允许为空，如果子表单项里面配置验证器，且又是单条模式。可以允许用户选择清空（不填）。
        self.nullable: bool = nullable
        # /**
        #    * 提示信息
        #    */
        #   messages?: {
        #     /**
        #      * 验证错误提示
        #      */
        #     validateFailed?: string;
        #
        #     /**
        #      * 最小值验证错误提示
        #      */
        #     minLengthValidateFailed?: string;
        #
        #     /**
        #      * 最大值验证错误提示
        #      */
        #     maxLengthValidateFailed?: string;
        #   };
        self.messages: Dict[str, str] = messages
        self.updatePristineAfterStoreDataReInit: bool = updatePristineAfterStoreDataReInit
        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputArray(FormBaseControlSchema):
    def __init__(
            self,
            items: SchemaNode = None,
            scaffold: object = None,
            addable: bool = None,
            removable: bool = None,
            draggable: bool = None,
            draggableTip: str = None,
            addButtonText: str = None,
            minLength: Number = None,
            maxLength: Number = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-array"
        # 成员渲染器配置
        self.items: SchemaNode = items
        # 是否可新增。
        self.addable: bool = addable
        # 是否可删除
        self.removable: bool = removable
        # 是否可以拖动排序, 需要注意的是当启用拖动排序的时候，会多一个$id 字段
        self.draggable: bool = draggable
        # 可拖拽的提示文字，默认为："可通过拖动每行中的【交换】按钮进行顺序调整"
        self.draggableTip: str = draggableTip
        # 新增按钮文字
        self.addButtonText: str = addButtonText
        # 限制最小长度
        self.minLength: Number = minLength
        # 限制最大长度
        self.maxLength: Number = maxLength
        # 新增成员时的默认值
        self.scaffold: object = scaffold

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputFormula(FormBaseControlSchema):
    """
    InputFormula 公式编辑器
    """

    def __init__(
            self,
            evalMode: bool = None,
            mixedMode: bool = None,
            variables: List[VariableItem] = None,
            variableMode: Literal["tabs", "tree"] = None,
            functions: List[FuncGroup] = None,
            title: str = None,
            header: str = None,
            inputMode: Literal["button", "input-button", "input-group"] = None,
            allowInput: bool = None,
            icon: SchemaIcon = None,
            btnLabel: str = None,
            level: Level = None,
            btnSize: Size = None,
            borderMode: BorderMode = None,
            placeholder: str = None,
            variableClassName: str = None,
            functionClassName: str = None,
            selfVariableName: str = None,
            inputSettings: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-formula"
        # evalMode 即直接就是表达式，否则
        #    * 需要 ${这里面才是表达式}
        #    * 默认为 true
        self.evalMode: bool = evalMode
        # 混合模式，意味着这个输入框既可以输入不同文本
        #    * 也可以输入公式。
        #    * 当输入公式时，值格式为 ${公式内容}
        #    * 其他内容当字符串。
        self.mixedMode: bool = mixedMode
        # 用于提示的变量集合，默认为空
        self.variables: List[VariableItem] = variables
        # 变量展现模式，可选值：'tabs' ｜ 'tree'
        self.variableMode: Literal["tabs", "tree"] = variableMode
        # 函数集合，默认不需要传，即  amis-formula 里面那个函数
        #    * 如果有扩充，则需要传。
        self.functions: List[FuncGroup] = functions
        # 编辑器标题
        self.title: str = title
        # 顶部标题，默认为表达式
        self.header: str = header
        # 控件模式
        self.inputMode: Literal["button", "input-button", "input-group"] = inputMode
        # 外层input是否允许输入，否需要点击fx在弹窗中输入
        self.allowInput: bool = allowInput
        # 按钮图标
        self.icon: SchemaIcon = icon
        # 按钮Label，inputMode为button时生效
        self.btnLabel: str = btnLabel
        # 按钮样式
        self.level: Level = level
        # 按钮大小
        self.btnSize: Size = btnSize
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 输入框占位符
        self.placeholder: str = placeholder
        # 变量面板CSS样式类名
        self.variableClassName: str = variableClassName
        # 函数面板CSS样式类名
        self.functionClassName: str = functionClassName
        # 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
        self.selfVariableName: str = selfVariableName
        # 输入框的类型
        self.inputSettings: str = inputSettings

        for key, value in kwargs.items():
            self.__dict__[key] = value


class ConditionBuilder(FormBaseControlSchema):
    """
    条件组合控件
    """

    def __init__(
            self,
            embed: bool = None,
            pickerIcon: Icon = None,
            funcs: object = None,
            fields: object = None,
            config: object = None,
            source: SchemaApi = None,
            builderMode: Literal["simple", "full"] = None,
            showANDOR: bool = None,
            draggable: bool = None,
            addBtnVisibleOn: str = None,
            formula: InputFormula = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "condition-builder"
        # 内嵌模式，默认为 true
        self.embed: bool = embed
        # 非内嵌模式时 弹窗触发icon
        self.pickerIcon: Icon = pickerIcon
        # 函数集合
        self.funcs: object = funcs
        # 字段集合
        self.fields: object = fields
        # 其他配置
        self.config: object = config
        # 通过远程拉取配置项
        self.source: SchemaApi = source
        # 展现模式
        self.builderMode: Literal["simple", "full"] = builderMode
        # 是否显示并或切换键按钮，只在简单模式下有用
        self.showANDOR: bool = showANDOR
        # 是否可拖拽，默认为 true
        self.draggable: bool = draggable
        # 表达式：控制按钮“添加条件”的显示
        self.addBtnVisibleOn: str = addBtnVisibleOn
        # 将字段输入控件变成公式编辑器。
        self.formula: InputFormula = formula
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Hidden(FormBaseControlSchema):
    """
    Hidden 隐藏字段
    """

    def __init__(
            self,
            **kwargs,
    ):
        super().__init__()
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Control(FormBaseControlSchema):
    """
    Control 表单项包裹

    展示类的组件，如果直接放在表单项里面，不会有 label 和 description 之类的信息展示。
    """

    def __init__(
            self,
            body: SchemaNode = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "control"
        self.body: SchemaNode = body
        for key, value in kwargs.items():
            self.__dict__[key] = value


class Formula(FormBaseControlSchema):
    """
        公式功能控件
    """

    def __init__(
            self,
            id: str = None,
            condition: str = None,
            autoSet: bool = None,
            formula: str = None,
            initSet: bool = None,
            name: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "formula"
        #  当某个按钮的目标指定为此值后，会触发一次公式应用。这个机制可以在 autoSet 为 false 时用来手动触发
        self.id: str = id
        # 触发公式的作用条件，如 data.xxx == \"a\" 或者 ${xx}
        self.condition: str = condition
        # 是否自动应用
        self.autoSet: bool = autoSet
        # 公式
        self.formula: str = formula
        # 是否初始应用
        self.initSet: bool = initSet
        # 字段名，公式结果将作用到此处指定的变量中去
        self.name: str = name

        for key, value in kwargs.items():
            self.__dict__[key] = value


class DiffEditor(FormBaseControlSchema):
    """
        DiffEditor 对比编辑器
    """

    def __init__(
            self,
            diffValue: str = None,
            language: str = None,
            options: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "diff-editor"
        #  左侧面板的值， 支持取变量。
        self.diffValue: str = diffValue
        # 语言，参考 monaco-editor
        self.language: str = language
        # 编辑器配置
        self.options: object = options

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputExcel(FormBaseControlSchema):
    """
        Excel 解析
    """

    def __init__(
            self,
            allSheets: bool = None,
            parseMode: Literal["array", "object"] = None,
            includeEmpty: bool = None,
            plainText: bool = None,
            parseImage: bool = None,
            imageDataURI: bool = None,
            placeholder: str = None,
            autoFill: Dict[str, str] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-excel"
        #  是否解析所有 sheet，默认情况下只解析第一个
        self.allSheets: bool = allSheets
        # 解析模式，array 是解析成二维数组，object 是将第一列作为字段名，解析为对象数组
        self.parseMode: Literal["array", "object"] = parseMode
        # 是否包含空内容，主要用于二维数组模式
        self.includeEmpty: bool = includeEmpty
        # 纯文本模式
        self.plainText: bool = plainText
        # 解析图片
        self.parseImage: bool = parseImage
        # 图片解析结果使用 data URI 格式
        self.imageDataURI: bool = imageDataURI
        # 占位文本提示
        self.placeholder: str = placeholder
        # 文件解析完成后将字段同步到表单内部
        self.autoFill: Dict[str, str] = autoFill
        # if autoFill is None:
        #     self.autoFill: Dict[str, str] = {"fileName": "${filename}"}

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputFile(FormBaseControlSchema):
    """
        InputFile
    """

    def __init__(
            self,
            btnLabel: str = None,
            accept: str = None,
            capture: str = None,
            asBase64: bool = None,
            asBlob: bool = None,
            autoUpload: bool = None,
            chunkApi: SchemaApi = None,
            chunkSize: Number = None,
            concurrency: Number = None,
            delimiter: str = None,
            downloadUrl: SchemaApi = None,
            templateUrl: SchemaApi = None,
            fileField: str = None,
            finishChunkApi: SchemaApi = None,
            hideUploadButton: bool = None,
            maxLength: Number = None,
            maxSize: Number = None,
            receiver: SchemaApi = None,
            startChunkApi: SchemaApi = None,
            useChunk: Union[str, bool] = None,
            btnClassName: SchemaClassName = None,
            btnUploadClassName: SchemaClassName = None,
            multiple: bool = None,
            joinValues: bool = None,
            extractValue: bool = None,
            resetValue: object = None,
            autoFill: Dict[str, str] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-file"
        #  上传文件按钮说明  @default 请选择文件
        self.btnLabel: str = btnLabel
        # 默认只支持纯文本，要支持其他类型，请配置此属性。建议直接填写文件后缀
        #    * 如：.txt,.csv
        #    *
        #    * 多个类型用逗号隔开。
        #    *
        #    * @default text/plain
        self.accept: str = accept
        # 控制 input 标签的 capture 属性，用于移动端拍照或录像。
        self.capture: str = capture
        # 如果上传的文件比较小可以设置此选项来简单的把文件 base64 的值给 form 一起提交，目前不支持多选。
        self.asBase64: bool = asBase64
        # 如果不希望 File 组件上传，可以配置 `asBlob` 或者 `asBase64`，采用这种方式后，组件不再自己上传了，而是直接把文件数据作为表单项的值，文件内容会在 Form 表单提交的接口里面一起带上。
        self.asBlob: bool = asBlob
        # 是否自动开始上传
        self.autoUpload: bool = autoUpload
        # 默认 `/api/upload/chunk` 想自己存储时才需要关注。
        self.chunkApi: SchemaApi = chunkApi
        # 分块大小，默认为 5M.
        self.chunkSize: Number = chunkSize
        # 分块上传的并发数
        self.concurrency: Number = concurrency
        # 分割符
        self.delimiter: str = delimiter
        # 默认显示文件路径的时候会支持直接下载，
        #    * 可以支持加前缀如：`http://xx.dom/filename=` ，
        #    * 如果不希望这样，可以把当前配置项设置为 `false`。
        #    *
        #    * 1.1.6 版本开始将支持变量 ${xxx} 来自己拼凑个下载地址，并且支持配置成 post.
        self.downloadUrl: SchemaApi = downloadUrl
        # 模板下载地址
        self.templateUrl: SchemaApi = templateUrl
        # 默认 `file`, 如果你不想自己存储，则可以忽略此属性。
        self.fileField: str = fileField
        # 默认 `/api/upload/finishChunkApi` 想自己存储时才需要关注。
        self.finishChunkApi: SchemaApi = finishChunkApi
        # 是否隐藏上传按钮
        self.hideUploadButton: bool = hideUploadButton
        # 最多的个数
        self.maxLength: Number = maxLength
        # 默认没有限制，当设置后，文件大小大于此值将不允许上传。
        self.maxSize: Number = maxSize
        # 默认 `/api/upload/file` 如果想自己存储，请设置此选项。
        self.receiver: SchemaApi = receiver
        # 默认 `/api/upload/startChunk` 想自己存储时才需要关注。
        self.startChunkApi: SchemaApi = startChunkApi
        # 默认为 'auto' amis 所在服务器，限制了文件上传大小不得超出10M，所以 amis 在用户选择大文件的时候，自动会改成分块上传模式。
        self.useChunk: Union[str, bool] = useChunk
        # 按钮 CSS 类名
        self.btnClassName: SchemaClassName = btnClassName
        # 上传按钮 CSS 类名
        self.btnUploadClassName: SchemaClassName = btnUploadClassName
        # 是否为多选
        self.multiple: bool = multiple
        #    * 1. 单选模式：当用户选中某个选项时，选项中的 value 将被作为该表单项的值提交，
        #    * 否则，整个选项对象都会作为该表单项的值提交。
        #    * 2. 多选模式：选中的多个选项的 `value` 会通过 `delimiter` 连接起来，
        #    * 否则直接将以数组的形式提交值。
        self.joinValues: bool = joinValues
        # 开启后将选中的选项 value 的值封装为数组，作为当前表单项的值。
        self.extractValue: bool = extractValue
        # 清除时设置的值
        self.resetValue: object = resetValue
        # 上传后把其他字段同步到表单内部。
        self.autoFill: Dict[str, str] = autoFill

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputNumber(FormBaseControlSchema):
    """
        数字输入框
    """

    def __init__(
            self,
            max: Number = None,
            min: Number = None,
            step: Number = None,
            precision: Number = None,
            showSteps: bool = None,
            borderMode: BorderMode = None,
            prefix: str = None,
            suffix: str = None,
            unitOptions: str | List[MixedOption] | List[str] | PlainObject = None,
            big: bool = None,
            kilobitSeparator: bool = None,
            readOnly: bool = None,
            keyboard: bool = None,
            displayMode: Literal["base", "enhance"] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-number"
        #  最大值
        self.max: Number = max
        # 最小值
        self.min: Number = min
        # 步长
        self.step: Number = step
        # 精度
        self.precision: Number = precision
        # 是否显示上下点击按钮
        self.showSteps: bool = showSteps
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # 前缀
        self.prefix: str = prefix
        # 后缀
        self.suffix: str = suffix
        # 单位列表
        self.unitOptions: str | List[MixedOption] | List[str] | PlainObject = unitOptions
        # 是否是大数，如果是的话输入输出都将是字符串
        self.big: bool = big
        # 是否千分分隔
        self.kilobitSeparator: bool = kilobitSeparator
        # 只读
        self.readOnly: bool = readOnly
        # 是否启用键盘行为
        self.keyboard: bool = keyboard
        # 输入框为基础输入框还是加强输入框
        self.displayMode: Literal["base", "enhance"] = displayMode

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputRange(FormBaseControlSchema):
    """
        InputRange 滑块

        可以用于选择单个数值或数值范围。
    """

    def __init__(
            self,
            value: Number = None,
            max: Number | str = None,
            min: Number | str = None,
            step: Number | str = None,
            unit: str = None,
            showSteps: bool = None,
            parts: Number | List[Number] = None,
            marks: Dict[str, object] = None,
            tooltipVisible: bool = None,
            tooltipPlacement: Placement = None,
            multiple: bool = None,
            joinValues: bool = None,
            delimiter: str = None,
            showInput: bool = None,
            disabled: bool = None,
            clearable: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-number"
        # 滑块值
        self.value: Number = value
        #  最大值
        self.max: Number | str = max
        # 最小值
        self.min: Number | str = min
        # 步长
        self.step: Number | str = step
        # 单位
        self.unit: str = unit
        # 是否展示步长
        self.showSteps: bool = showSteps
        # 分割块数
        self.parts: Number | List[Number] = parts
        # 刻度
        self.marks: Dict[str, object] = marks
        # 是否展示标签
        self.tooltipVisible: bool = tooltipVisible
        # 标签方向
        self.tooltipPlacement: Placement = tooltipPlacement
        # 是否为双滑块
        self.multiple: bool = multiple
        # 是否通过分隔符连接
        self.joinValues: bool = joinValues
        # 分隔符
        self.delimiter: str = delimiter
        # 是否展示输入框
        self.showInput: bool = showInput
        # 是否禁用
        self.disabled: bool = disabled
        # 输入框是否可清除
        self.clearable: bool = clearable

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputRating(FormBaseControlSchema):
    """
        InputRating 评分
    """

    def __init__(
            self,
            count: Number = None,
            half: bool = None,
            allowClear: bool = None,
            readonly: bool = None,
            colors: str | Dict[str, str] = None,
            inactiveColor: str = None,
            texts: Dict[str, str] = None,
            marks: Dict[str, object] = None,
            textPosition: Placement = None,
            char: str = None,
            charClassName: str = None,
            textClassName: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-rating"
        # 分数
        self.count: Number = count
        #  允许半颗星
        self.half: bool = half
        # 是否允许再次点击后清除
        self.allowClear: bool = allowClear
        # 是否只读
        self.readonly: bool = readonly
        # 星星被选中的颜色
        self.colors: str | Dict[str, str] = colors
        # 未被选中的星星的颜色
        self.inactiveColor: str = inactiveColor
        # 星星被选中时的提示文字
        self.texts: Dict[str, str] = texts
        # 刻度
        self.marks: Dict[str, object] = marks
        # 文字的位置
        self.textPosition: Placement = textPosition
        # 自定义字符
        self.char: str = char
        # 自定义字符类名
        self.charClassName: str = charClassName
        # 自定义文字类名
        self.textClassName: str = textClassName

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputRepeat(FormBaseControlSchema):
    """
       InputRepeat 重复频率选择器
    """

    def __init__(
            self,
            options: Literal[
                "secondly", "minutely", "hourly", "daily", "weekdays", "weekly", "monthly", "yearly"] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-repeat"
        self.options: Literal[
            "secondly", "minutely", "hourly", "daily", "weekdays", "weekly", "monthly", "yearly"] = options

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputRichText(FormBaseControlSchema):
    """
      InputRichText 富文本编辑器

      目前富文本编辑器基于两个库：froala 和 tinymce，默认使用 tinymce。
    """

    def __init__(
            self,
            vendor: Literal["froala", "tinymce"] = None,
            receiver: SchemaApi = None,
            videoReceiver: SchemaApi = None,
            fileField: str = None,
            borderMode: BorderMode = None,
            options: Dict[str, object] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-rich-text"
        # 编辑器类型
        self.vendor: Literal["froala", "tinymce"] = vendor
        # 图片保存 API
        self.receiver: SchemaApi = receiver
        # 视频保存 API
        self.videoReceiver: SchemaApi = videoReceiver
        # 接收器的字段名
        self.fileField: str = fileField
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: BorderMode = borderMode
        # tinymce 或 froala 的配置
        self.options: Dict[str, object] = options

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Radio(FormBaseControlSchema):
    """
     Radio 单选框。
    """

    def __init__(
            self,
            trueValue: Union[bool, str, Number] = None,
            falseValue: Union[bool, str, Number] = None,
            option: str = None,
            badge: Badge = None,
            optionType: Literal["default", "button"] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "radio"
        # 勾选值
        self.trueValue: Union[bool, str, Number] = trueValue
        # 未勾选值
        self.falseValue: Union[bool, str, Number] = falseValue
        # 选项说明
        self.option: str = option
        # 角标
        self.badge: Badge = badge
        self.optionType: Literal["default", "button"] = optionType

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Radios(FormOptionsControl):
    """
     Radios 单选框。
    """

    def __init__(
            self,
            columnsCount: Number = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "radios"
        # 每行显示多少个
        self.columnsCount: Number = columnsCount

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Switch(FormBaseControlSchema):
    """
    Switch 开关
    """

    def __init__(
            self,
            trueValue: Union[bool, str, Number] = None,
            falseValue: Union[bool, str, Number] = None,
            option: str = None,
            onText: Union[bool, str, Number] = None,
            offText: Union[bool, str, Number] = None,
            size: Size = None,
            loading: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "switch"
        # 勾选值
        self.trueValue: Union[bool, str, Number] = trueValue
        # 未勾选值
        self.falseValue: Union[bool, str, Number] = falseValue
        # 选项说明
        self.option: str = option
        # 开启时显示的内容
        self.onText: Union[str, Icon, SchemaNode] = onText
        # 关闭时显示的内容
        self.offText: Union[str, Icon, SchemaNode] = offText
        # 开关尺寸
        self.size: Size = size
        # 是否处于加载状态
        self.loading: bool = loading

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Group(FormBaseControlSchema):
    """
    Group 表单项组

    表单项，默认都是一行显示一个，Group 组件用于在一行展示多个表单项，会自动根据表单项数量均分宽度。
    """

    def __init__(
            self,
            className: str = None,
            label: str = None,
            body: List[SchemaNode] = None,
            gap: Literal["xs", "sm", "normal"] = None,
            direction: Literal["horizontal", "vertical"] = None,
            subFormMode: Literal["normal", "inline", "horizontal"] = None,
            subFormHorizontal: FormHorizontal = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "group"
        self.className: str = className
        self.label: str = label
        # FormItem 集合
        self.body: List[SchemaNode] = body
        # 间隔
        self.gap: Literal["xs", "sm", "normal"] = gap
        # 配置时垂直摆放还是左右摆放。
        self.direction: Literal["horizontal", "vertical"] = direction
        # 配置子表单项默认的展示方式。
        self.subFormMode: Literal["normal", "inline", "horizontal"] = subFormMode
        # 如果是水平排版，这个属性可以细化水平排版的左右宽度占比。
        self.subFormHorizontal: FormHorizontal = subFormHorizontal

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputGroup(FormBaseControlSchema):
    """
     Input-Group 输入框组合

    输入框组合选择器 可用于输入框与其他组件进行组合。
    """

    def __init__(
            self,
            body: SchemaNode = None,
            validationConfig: ValidationConfig = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-group"
        # FormItem 集合
        self.body: SchemaNode = body
        # 校验提示信息配置
        self.validationConfig: ValidationConfig = validationConfig

        for key, value in kwargs.items():
            self.__dict__[key] = value


class ButtonToolbar(BaseSchema):
    """
     Button-Toolbar 按钮工具栏

     默认按钮会独占一行，如果想让多个按钮并排方式，可以使用 button-toolbar 组件包裹起来，另外还有能用 button-group 来在展现上更紧凑。
    """

    def __init__(
            self,
            buttons: List[Action] = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "button-toolbar"
        # 按钮组
        self.buttons: List[Action] = buttons

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputImageCrop(Renderable):
    def __init__(
            self,
            aspectRatio: Number = None,
            rotatable: bool = None,
            scalable: bool = None,
            viewMode: Number = None,
    ):
        super().__init__()
        # 裁剪比例。浮点型，默认 1 即 1:1，如果要设置 16:9 请设置 1.7777777777777777 即 16 / 9。
        self.aspectRatio: Number = aspectRatio
        # 裁剪时是否可旋转
        self.rotatable: bool = rotatable
        # 裁剪时是否可缩放
        self.scalable: bool = scalable
        # 裁剪时的查看模式，0 是无限制
        self.viewMode: Number = viewMode


class InputImage(FormBaseControlSchema):
    def __init__(
            self,
            src: str = None,
            imageClassName: SchemaClassName = None,
            accept: str = None,
            allowInput: bool = None,
            autoUpload: bool = None,
            uploadBtnText: str = None,
            btnClassName: SchemaClassName = None,
            btnUploadClassName: SchemaClassName = None,
            crop: Union[bool, InputImageCrop] = None,
            cropFormat: str = None,
            cropQuality: Number = None,
            reCropable: bool = None,
            hideUploadButton: bool = None,
            limit: Limit = None,
            maxLength: Number = None,
            maxSize: Number = None,
            receiver: SchemaApi = None,
            multiple: bool = None,
            capture: str = None,
            joinValues: bool = None,
            delimiter: str = None,
            extractValue: bool = None,
            resetValue: any = None,
            thumbMode: Literal["w-full", "h-full", "contain", "cover"] = None,
            thumbRatio: Literal['1:1', '4:3', '16:9'] = None,
            autoFill: Dict[str, str] = None,
            initAutoFill: bool = None,
            initCrop: bool = None,
            dropCrop: bool = None,
            frameImage: str = None,
            fixedSize: bool = None,
            fixedSizeClassName: SchemaClassName = None,
            draggable: bool = None,
            draggableTip: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-image"
        # 默认展示图片的链接
        self.src: str = src
        # 默认展示图片的类名
        self.imageClassName: SchemaClassName = imageClassName
        # 支持的图片类型格式，请配置此属性为图片后缀，例如.jpg,.png
        self.accept: str = accept
        # 默认都是通过用户选择图片后上传返回图片地址，如果开启此选项，则可以允许用户图片地址。
        self.allowInput: bool = allowInput
        # 是否自动开始上传
        self.autoUpload: bool = autoUpload
        # 上传按钮文案
        self.uploadBtnText: str = uploadBtnText
        # 选择图片按钮的 CSS 类名
        self.btnClassName: SchemaClassName = btnClassName
        # 上传按钮的 CSS 类名
        self.btnUploadClassName: SchemaClassName = btnUploadClassName
        # 用来设置是否支持裁剪。
        self.crop: Union[bool, InputImageCrop] = crop
        # 裁剪后的图片类型
        self.cropFormat: str = cropFormat
        # 裁剪后的质量
        self.cropQuality: Number = cropQuality
        # 是否允许二次裁剪。裁剪文件格式的质量，用于 jpeg/webp，取值在 0 和 1 之间
        self.reCropable: bool = reCropable
        # 是否隐藏上传按钮
        self.hideUploadButton: bool = hideUploadButton
        # 限制图片大小，超出不让上传。
        self.limit: Limit = limit
        # 最多的个数，默认没有限制，当设置后，一次只允许上传指定数量文件。
        self.maxLength: Number = maxLength
        # 默认没有限制，当设置后，文件大小大于此值将不允许上传。
        self.maxSize: Number = maxSize
        # 默认 `/api/upload` 如果想自己存储，请设置此选项。
        self.receiver: SchemaApi = receiver
        # 是否为多选
        self.multiple: bool = multiple
        # 用于控制 input[type=file] 标签的 capture 属性，在移动端可控制输入来源
        self.capture: str = capture
        # 单选模式：当用户选中某个选项时，选项中的 value 将被作为该表单项的值提交，否则，整个选项对象都会作为该表单项的值提交。
        # 多选模式：选中的多个选项的 `value` 会通过 `delimiter` 连接起来，否则直接将以数组的形式提交值。
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 开启后将选中的选项 value 的值封装为数组，作为当前表单项的值。
        self.extractValue: bool = extractValue
        # 清除时设置的值
        self.resetValue: any = resetValue
        # 缩路图展示模式
        self.thumbMode: Literal["w-full", "h-full", "contain", "cover"] = thumbMode
        # 缩路图展示比率。
        self.thumbRatio: Literal['1:1', '4:3', '16:9'] = thumbRatio
        # 上传后把其他字段同步到表单内部。
        self.autoFill: Dict[str, str] = autoFill
        # 初始化时是否把其他字段同步到表单内部。
        self.initAutoFill: bool = initAutoFill
        # 初始化时是否打开裁剪模式
        self.initCrop: bool = initCrop
        # 图片上传完毕是否进入裁剪模式
        self.dropCrop: bool = dropCrop
        # 默认占位图图片地址
        self.frameImage: str = frameImage
        # 是否开启固定尺寸, 是否开启固定尺寸,若开启，需同时设置 fixedSizeClassName
        self.fixedSize: bool = fixedSize
        # 固定尺寸的 CSS类名。	开启固定尺寸时，根据此值控制展示尺寸。例如h-30,即图片框高为 h-30,AMIS 将自动缩放比率设置默认图所占位置的宽度，最终上传图片根据此尺寸对应缩放。
        self.fixedSizeClassName: SchemaClassName = fixedSizeClassName
        # 是否可拖拽排序
        self.draggable: bool = draggable
        # 可拖拽排序的提示信息
        self.draggableTip: str = draggableTip

        for key, value in kwargs.items():
            self.__dict__[key] = value


class FieldSet(FormBaseControl):
    def __init__(
            self,
            titlePosition: Literal["top", "bottom"] = None,
            collapsable: bool = None,
            collapsed: bool = None,
            body: SchemaNode = None,
            title: SchemaTpl = None,
            collapseTitle: SchemaTpl = None,
            mountOnEnter: bool = None,
            unmountOnExit: bool = None,
            subFormMode: Literal["normal", "inline", "horizontal"] = None,
            subFormHorizontal: FormHorizontal = None,
            className: str = None,
            headingClassName: str = None,
            bodyClassName: str = None,
            size: Size = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "fieldset"
        # 标题展示位置
        self.titlePosition: Literal["top", "bottom"] = titlePosition
        # 是否可折叠
        self.collapsable: bool = collapsable
        # 默认是否折叠
        self.collapsed: bool = collapsed
        # 内容区域
        self.body: SchemaNode = body
        # 标题
        self.title: SchemaTpl = title
        # 收起的标题
        self.collapseTitle: SchemaTpl = collapseTitle
        # 点开时才加载内容
        self.mountOnEnter: bool = mountOnEnter
        # 卡片隐藏就销毁内容。
        self.unmountOnExit: bool = unmountOnExit
        # 配置子表单项默认的展示方式。
        self.subFormMode: Literal["normal", "inline", "horizontal"] = subFormMode
        # 如果是水平排版，这个属性可以细化水平排版的左右宽度占比。
        self.subFormHorizontal: FormHorizontal = subFormHorizontal
        # CSS 类名
        self.className: str = className
        # 标题 CSS 类名
        self.headingClassName: str = headingClassName
        # 内容区域 CSS 类名
        self.bodyClassName: str = bodyClassName
        # 大小，支持 xs、sm、base、md、lg
        self.size: Size = size

        for key, value in kwargs.items():
            self.__dict__[key] = value


class ListSelect(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,
            autoFill: any = None,
            submitOnDBClick: bool = None,
            imageClassName: str = None,
            itemSchema: SchemaNode = None,
            activeItemSchema: SchemaCollection = None,
            listClassName: SchemaClassName = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "list-select"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue
        # 自动填充
        self.autoFill: any = autoFill
        # 开启双击点选并提交。
        self.submitOnDBClick: bool = submitOnDBClick
        # 图片div类名
        self.imageClassName: str = imageClassName
        # 可以自定义展示模板。
        self.itemSchema: SchemaNode = itemSchema
        # 激活态自定义展示模板。
        self.activeItemSchema: SchemaCollection = activeItemSchema
        # 支持配置 list div 的 css 类名, 比如：flex justify-between
        self.listClassName: SchemaClassName = listClassName

        for key, value in kwargs.items():
            self.__dict__[key] = value


class UUID(FormBaseControlSchema):
    def __init__(
            self,
            length: Number = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "uuid"
        # 长度，默认 uuid 的长度是 36，如果不需要那么长，可以设置这个来缩短
        self.length: Number = length

        for key, value in kwargs.items():
            self.__dict__[key] = value


class NestedSelect(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,
            autoFill: any = None,
            cascade: bool = None,
            withChildren: bool = None,
            onlyChildren: bool = None,
            searchable: bool = None,
            searchPromptText: str = None,
            noResultsText: str = None,
            hideNodePathLabel: bool = None,
            onlyLeaf: bool = None,
            maxTagCount: Number = None,
            overflowTagPopover: SchemaTooltip = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "list-select"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue
        # 自动填充
        self.autoFill: any = autoFill
        # 设置 true时，当选中父节点时不自动选择子节点。
        self.cascade: bool = cascade
        # 设置 true时，选中父节点时，值里面将包含子节点的值，否则只会保留父节点的值。
        self.withChildren: bool = withChildren
        # 多选时，选中父节点时，是否只将其子节点加入到值中。
        self.onlyChildren: bool = onlyChildren
        # 可否搜索
        self.searchable: bool = searchable
        # 搜索框占位文本
        self.searchPromptText: str = searchPromptText
        # 无结果时的文本
        self.noResultsText: str = noResultsText
        # 是否隐藏选择框中已选择节点的路径 label 信息
        self.hideNodePathLabel: bool = hideNodePathLabel
        # 只允许选择叶子节点
        self.onlyLeaf: bool = onlyLeaf
        # 标签的最大展示数量，超出数量后以收纳浮层的方式展示，仅在多选模式开启后生效
        self.maxTagCount: Number = maxTagCount
        # 收纳浮层的配置属性
        self.overflowTagPopover: SchemaTooltip = overflowTagPopover

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Picker(FormBaseControlSchema):
    """
     Picker 列表选择器

     列表选取，在功能上和 Select 类似，但它能显示更复杂的信息。
    """

    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,
            autoFill: any = None,
            modalTitle: str = None,
            modalMode: Literal["dialog", "drawer"] = None,
            pickerSchema: any = None,
            embed: bool = None,
            overflowConfig: OverflowConfig = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "picker"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue
        # 自动填充
        self.autoFill: any = autoFill
        # 设置模态框的标题
        self.modalTitle: str = modalTitle
        # 设置 dialog 或者 drawer，用来配置弹出方式。
        self.modalMode: Literal["dialog", "drawer"] = modalMode
        # 即用 List 类型的渲染，来展示列表信息。更多配置参考 CRUD
        self.pickerSchema: any = pickerSchema
        # 内嵌模式，也就是说不弹框了。
        self.embed: bool = embed
        # 搜索框占位文本
        self.overflowConfig: OverflowConfig = overflowConfig

        for key, value in kwargs.items():
            self.__dict__[key] = value


class InputTag(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,
            clearable: bool = None,
            resetValue: str = None,
            max: Number = None,
            maxTagLength: Number = None,
            maxTagCount: Number = None,
            overflowTagPopover: SchemaTooltip = None,
            enableBatchAdd: bool = None,
            separator: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "input-tag"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue
        # 在有值的时候是否显示一个删除图标在右侧。
        self.clearable: any = clearable
        # 删除后设置此配置项给定的值。
        self.resetValue: str = resetValue
        # 允许添加的标签的最大数量
        self.max: Number = max
        # 单个标签的最大文本长度
        self.maxTagLength: Number = maxTagLength
        # 标签的最大展示数量，超出数量后以收纳浮层的方式展示，仅在多选模式开启后生效
        self.maxTagCount: Number = maxTagCount
        # 收纳浮层的配置属性
        self.overflowTagPopover: SchemaTooltip = overflowTagPopover
        # 是否开启批量添加模式
        self.enableBatchAdd: bool = enableBatchAdd
        # 开启批量添加后，输入多个标签的分隔符，支持传入多个符号，默认为"-"
        self.separator: str = separator

        for key, value in kwargs.items():
            self.__dict__[key] = value


class TextArea(FormBaseControlSchema):
    def __init__(
            self,
            maxRows: Number = None,
            minRows: Number = None,
            readOnly: bool = None,
            borderMode: Literal['full', 'half', 'none'] = None,
            maxLength: Number = None,
            showCounter: bool = None,
            clearable: bool = None,
            resetValue: str = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "textarea"
        # 最大行数
        self.maxRows: Number = maxRows
        # 最小行数
        self.minRows: Number = minRows
        # 是否只读
        self.readOnly: bool = readOnly
        # 边框模式，全边框，还是半边框，或者没边框。
        self.borderMode: Literal['full', 'half', 'none'] = borderMode
        # 限制文字个数
        self.maxLength: Number = maxLength
        # 是否显示计数
        self.showCounter: bool = showCounter
        # 输入内容是否可清除
        self.clearable: bool = clearable
        # 重置值
        self.resetValue: str = resetValue

        for key, value in kwargs.items():
            self.__dict__[key] = value


class Transfer(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,

            showArrow: bool = None,
            sortable: bool = None,
            searchApi: SchemaApi = None,
            resultListModeFollowSelect: bool = None,
            statistics: bool = None,
            selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = None,
            searchable: bool = None,
            resultSearchable: bool = None,
            selectTitle: str = None,
            resultTitle: str = None,
            menuTpl: SchemaNode = None,
            valueTpl: SchemaNode = None,
            searchPlaceholder: str = None,
            resultSearchPlaceholder: str = None,
            itemHeight: Number = None,
            virtualThreshold: Number = None,
            showInvalidMatch: bool = None,
            onlyChildren: bool = None,
            leftOptions: List[Option] = None,
            leftMode: Literal['tree', 'list'] = None,
            rightMode: Literal['table', 'list', 'tree', 'chained'] = None,
            searchResultMode: Literal['table', 'list', 'tree', 'chained'] = None,
            columns: List[object] = None,
            searchResultColumns: List[object] = None,
            pagination: object = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "transfer"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue

        # 是否显示剪头
        self.showArrow: bool = showArrow
        # 可排序？
        self.sortable: bool = sortable
        # 如果想通过接口检索，可以设置这个 api。
        self.searchApi: SchemaApi = searchApi
        # 结果面板跟随模式，目前只支持list、table、tree（tree 目前只支持非延时加载的tree）
        self.resultListModeFollowSelect: bool = resultListModeFollowSelect
        # 是否显示统计数据
        self.statistics: bool = statistics
        # 勾选展示模式
        self.selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = selectMode
        # 可搜索？
        self.searchable: bool = searchable
        # 结果（右则）列表的检索功能，当设置为true时，可以通过输入检索模糊匹配检索内容
        self.resultSearchable: bool = resultSearchable
        # 左侧的标题文字
        self.selectTitle: str = selectTitle
        # 右侧结果的标题文字
        self.resultTitle: str = resultTitle
        # 用来丰富选项展示
        self.menuTpl: SchemaNode = menuTpl
        # 用来丰富值的展示
        self.valueTpl: SchemaNode = valueTpl
        # 左侧列表搜索框提示
        self.searchPlaceholder: str = searchPlaceholder
        # 右侧列表搜索框提示
        self.resultSearchPlaceholder: str = resultSearchPlaceholder
        # 单个选项的高度，主要用于虚拟渲染
        self.itemHeight: Number = itemHeight
        # 在选项数量达到多少时开启虚拟渲染
        self.virtualThreshold: Number = virtualThreshold
        # 当在value值未匹配到当前options中的选项时，是否value值对应文本飘红显示
        self.showInvalidMatch: bool = showInvalidMatch
        # 树形模式下，仅选中子节点
        self.onlyChildren: bool = onlyChildren
        # 当 selectMode 为 associated 时用来定义左侧的选项
        self.leftOptions: List[Option] = leftOptions
        # 当 selectMode 为 associated 时用来定义左侧的选择模式
        self.leftMode: Literal['tree', 'list'] = leftMode
        # 当 selectMode 为 associated 时用来定义右侧的选择模式
        self.rightMode: Literal['table', 'list', 'tree', 'chained'] = rightMode
        # 搜索结果展示模式
        self.searchResultMode: Literal['table', 'list', 'tree', 'chained'] = searchResultMode
        # 当 selectMode 为 table 时定义表格列信息。
        self.columns: List[object] = columns
        # 当 searchResultMode 为 table 时定义表格列信息。
        self.searchResultColumns: List[object] = searchResultColumns
        # 分页配置，selectMode为默认和table才会生效
        self.pagination: object = pagination

        for key, value in kwargs.items():
            self.__dict__[key] = value


class TransferPicker(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,

            showArrow: bool = None,
            sortable: bool = None,
            searchApi: SchemaApi = None,
            resultListModeFollowSelect: bool = None,
            statistics: bool = None,
            selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = None,
            searchable: bool = None,
            resultSearchable: bool = None,
            selectTitle: str = None,
            resultTitle: str = None,
            menuTpl: SchemaNode = None,
            valueTpl: SchemaNode = None,
            searchPlaceholder: str = None,
            resultSearchPlaceholder: str = None,
            itemHeight: Number = None,
            virtualThreshold: Number = None,
            showInvalidMatch: bool = None,
            onlyChildren: bool = None,
            leftOptions: List[Option] = None,
            leftMode: Literal['tree', 'list'] = None,
            rightMode: Literal['table', 'list', 'tree', 'chained'] = None,
            searchResultMode: Literal['table', 'list', 'tree', 'chained'] = None,
            columns: List[object] = None,
            searchResultColumns: List[object] = None,
            pagination: object = None,

            borderMode: Literal['full', 'half', 'none'] = None,
            pickerSize: Size = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "transfer-picker"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue

        # 是否显示剪头
        self.showArrow: bool = showArrow
        # 可排序？
        self.sortable: bool = sortable
        # 如果想通过接口检索，可以设置这个 api。
        self.searchApi: SchemaApi = searchApi
        # 结果面板跟随模式，目前只支持list、table、tree（tree 目前只支持非延时加载的tree）
        self.resultListModeFollowSelect: bool = resultListModeFollowSelect
        # 是否显示统计数据
        self.statistics: bool = statistics
        # 勾选展示模式
        self.selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = selectMode
        # 可搜索？
        self.searchable: bool = searchable
        # 结果（右则）列表的检索功能，当设置为true时，可以通过输入检索模糊匹配检索内容
        self.resultSearchable: bool = resultSearchable
        # 左侧的标题文字
        self.selectTitle: str = selectTitle
        # 右侧结果的标题文字
        self.resultTitle: str = resultTitle
        # 用来丰富选项展示
        self.menuTpl: SchemaNode = menuTpl
        # 用来丰富值的展示
        self.valueTpl: SchemaNode = valueTpl
        # 左侧列表搜索框提示
        self.searchPlaceholder: str = searchPlaceholder
        # 右侧列表搜索框提示
        self.resultSearchPlaceholder: str = resultSearchPlaceholder
        # 单个选项的高度，主要用于虚拟渲染
        self.itemHeight: Number = itemHeight
        # 在选项数量达到多少时开启虚拟渲染
        self.virtualThreshold: Number = virtualThreshold
        # 当在value值未匹配到当前options中的选项时，是否value值对应文本飘红显示
        self.showInvalidMatch: bool = showInvalidMatch
        # 树形模式下，仅选中子节点
        self.onlyChildren: bool = onlyChildren
        # 当 selectMode 为 associated 时用来定义左侧的选项
        self.leftOptions: List[Option] = leftOptions
        # 当 selectMode 为 associated 时用来定义左侧的选择模式
        self.leftMode: Literal['tree', 'list'] = leftMode
        # 当 selectMode 为 associated 时用来定义右侧的选择模式
        self.rightMode: Literal['table', 'list', 'tree', 'chained'] = rightMode
        # 搜索结果展示模式
        self.searchResultMode: Literal['table', 'list', 'tree', 'chained'] = searchResultMode
        # 当 selectMode 为 table 时定义表格列信息。
        self.columns: List[object] = columns
        # 当 searchResultMode 为 table 时定义表格列信息。
        self.searchResultColumns: List[object] = searchResultColumns
        # 分页配置，selectMode为默认和table才会生效
        self.pagination: object = pagination

        # 边框模式，'full'为全边框，'half'为半边框，'none'为没边框
        self.borderMode: Literal['full', 'half', 'none'] = borderMode
        # 弹窗大小，支持: xs、sm、md、lg、xl、full
        self.pickerSize: Size = pickerSize

        for key, value in kwargs.items():
            self.__dict__[key] = value


class TabsTransfer(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,

            showArrow: bool = None,
            sortable: bool = None,
            searchApi: SchemaApi = None,
            resultListModeFollowSelect: bool = None,
            statistics: bool = None,
            selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = None,
            searchable: bool = None,
            resultSearchable: bool = None,
            selectTitle: str = None,
            resultTitle: str = None,
            menuTpl: SchemaNode = None,
            valueTpl: SchemaNode = None,
            searchPlaceholder: str = None,
            resultSearchPlaceholder: str = None,
            itemHeight: Number = None,
            virtualThreshold: Number = None,
            showInvalidMatch: bool = None,
            onlyChildren: bool = None,
            leftOptions: List[Option] = None,
            leftMode: Literal['tree', 'list'] = None,
            rightMode: Literal['table', 'list', 'tree', 'chained'] = None,
            searchResultMode: Literal['table', 'list', 'tree', 'chained'] = None,
            columns: List[object] = None,
            searchResultColumns: List[object] = None,
            pagination: object = None,

            borderMode: Literal['full', 'half', 'none'] = None,
            pickerSize: Size = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "tabs-transfer"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue

        # 是否显示剪头
        self.showArrow: bool = showArrow
        # 可排序？
        self.sortable: bool = sortable
        # 如果想通过接口检索，可以设置这个 api。
        self.searchApi: SchemaApi = searchApi
        # 结果面板跟随模式，目前只支持list、table、tree（tree 目前只支持非延时加载的tree）
        self.resultListModeFollowSelect: bool = resultListModeFollowSelect
        # 是否显示统计数据
        self.statistics: bool = statistics
        # 勾选展示模式
        self.selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = selectMode
        # 可搜索？
        self.searchable: bool = searchable
        # 结果（右则）列表的检索功能，当设置为true时，可以通过输入检索模糊匹配检索内容
        self.resultSearchable: bool = resultSearchable
        # 左侧的标题文字
        self.selectTitle: str = selectTitle
        # 右侧结果的标题文字
        self.resultTitle: str = resultTitle
        # 用来丰富选项展示
        self.menuTpl: SchemaNode = menuTpl
        # 用来丰富值的展示
        self.valueTpl: SchemaNode = valueTpl
        # 左侧列表搜索框提示
        self.searchPlaceholder: str = searchPlaceholder
        # 右侧列表搜索框提示
        self.resultSearchPlaceholder: str = resultSearchPlaceholder
        # 单个选项的高度，主要用于虚拟渲染
        self.itemHeight: Number = itemHeight
        # 在选项数量达到多少时开启虚拟渲染
        self.virtualThreshold: Number = virtualThreshold
        # 当在value值未匹配到当前options中的选项时，是否value值对应文本飘红显示
        self.showInvalidMatch: bool = showInvalidMatch
        # 树形模式下，仅选中子节点
        self.onlyChildren: bool = onlyChildren
        # 当 selectMode 为 associated 时用来定义左侧的选项
        self.leftOptions: List[Option] = leftOptions
        # 当 selectMode 为 associated 时用来定义左侧的选择模式
        self.leftMode: Literal['tree', 'list'] = leftMode
        # 当 selectMode 为 associated 时用来定义右侧的选择模式
        self.rightMode: Literal['table', 'list', 'tree', 'chained'] = rightMode
        # 搜索结果展示模式
        self.searchResultMode: Literal['table', 'list', 'tree', 'chained'] = searchResultMode
        # 当 selectMode 为 table 时定义表格列信息。
        self.columns: List[object] = columns
        # 当 searchResultMode 为 table 时定义表格列信息。
        self.searchResultColumns: List[object] = searchResultColumns
        # 分页配置，selectMode为默认和table才会生效
        self.pagination: object = pagination

        # 边框模式，'full'为全边框，'half'为半边框，'none'为没边框
        self.borderMode: Literal['full', 'half', 'none'] = borderMode
        # 弹窗大小，支持: xs、sm、md、lg、xl、full
        self.pickerSize: Size = pickerSize

        for key, value in kwargs.items():
            self.__dict__[key] = value


class TabsTransferPicker(FormBaseControlSchema):
    def __init__(
            self,
            options: MixedOption = None,
            source: SchemaApi = None,
            multiple: bool = None,
            delimiter: str = None,
            labelField: str = None,
            valueField: str = None,
            joinValues: bool = None,
            extractValue: bool = None,

            showArrow: bool = None,
            sortable: bool = None,
            searchApi: SchemaApi = None,
            resultListModeFollowSelect: bool = None,
            statistics: bool = None,
            selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = None,
            searchable: bool = None,
            resultSearchable: bool = None,
            selectTitle: str = None,
            resultTitle: str = None,
            menuTpl: SchemaNode = None,
            valueTpl: SchemaNode = None,
            searchPlaceholder: str = None,
            resultSearchPlaceholder: str = None,
            itemHeight: Number = None,
            virtualThreshold: Number = None,
            showInvalidMatch: bool = None,
            onlyChildren: bool = None,
            leftOptions: List[Option] = None,
            leftMode: Literal['tree', 'list'] = None,
            rightMode: Literal['table', 'list', 'tree', 'chained'] = None,
            searchResultMode: Literal['table', 'list', 'tree', 'chained'] = None,
            columns: List[object] = None,
            searchResultColumns: List[object] = None,
            pagination: object = None,

            borderMode: Literal['full', 'half', 'none'] = None,
            pickerSize: Size = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "tabs-transfer-picker"
        # 选项组
        self.options: MixedOption = options
        # 动态选项组
        self.source: SchemaApi = source
        # 多选
        self.multiple: bool = multiple
        # 选项标签字段
        self.labelField: str = labelField
        # 选项值字段
        self.valueField: str = valueField
        # 拼接值
        self.joinValues: bool = joinValues
        # 分割符
        self.delimiter: str = delimiter
        # 提取值
        self.extractValue: bool = extractValue

        # 是否显示剪头
        self.showArrow: bool = showArrow
        # 可排序？
        self.sortable: bool = sortable
        # 如果想通过接口检索，可以设置这个 api。
        self.searchApi: SchemaApi = searchApi
        # 结果面板跟随模式，目前只支持list、table、tree（tree 目前只支持非延时加载的tree）
        self.resultListModeFollowSelect: bool = resultListModeFollowSelect
        # 是否显示统计数据
        self.statistics: bool = statistics
        # 勾选展示模式
        self.selectMode: Literal['table', 'list', 'tree', 'chained', 'associated'] = selectMode
        # 可搜索？
        self.searchable: bool = searchable
        # 结果（右则）列表的检索功能，当设置为true时，可以通过输入检索模糊匹配检索内容
        self.resultSearchable: bool = resultSearchable
        # 左侧的标题文字
        self.selectTitle: str = selectTitle
        # 右侧结果的标题文字
        self.resultTitle: str = resultTitle
        # 用来丰富选项展示
        self.menuTpl: SchemaNode = menuTpl
        # 用来丰富值的展示
        self.valueTpl: SchemaNode = valueTpl
        # 左侧列表搜索框提示
        self.searchPlaceholder: str = searchPlaceholder
        # 右侧列表搜索框提示
        self.resultSearchPlaceholder: str = resultSearchPlaceholder
        # 单个选项的高度，主要用于虚拟渲染
        self.itemHeight: Number = itemHeight
        # 在选项数量达到多少时开启虚拟渲染
        self.virtualThreshold: Number = virtualThreshold
        # 当在value值未匹配到当前options中的选项时，是否value值对应文本飘红显示
        self.showInvalidMatch: bool = showInvalidMatch
        # 树形模式下，仅选中子节点
        self.onlyChildren: bool = onlyChildren
        # 当 selectMode 为 associated 时用来定义左侧的选项
        self.leftOptions: List[Option] = leftOptions
        # 当 selectMode 为 associated 时用来定义左侧的选择模式
        self.leftMode: Literal['tree', 'list'] = leftMode
        # 当 selectMode 为 associated 时用来定义右侧的选择模式
        self.rightMode: Literal['table', 'list', 'tree', 'chained'] = rightMode
        # 搜索结果展示模式
        self.searchResultMode: Literal['table', 'list', 'tree', 'chained'] = searchResultMode
        # 当 selectMode 为 table 时定义表格列信息。
        self.columns: List[object] = columns
        # 当 searchResultMode 为 table 时定义表格列信息。
        self.searchResultColumns: List[object] = searchResultColumns
        # 分页配置，selectMode为默认和table才会生效
        self.pagination: object = pagination

        # 边框模式，'full'为全边框，'half'为半边框，'none'为没边框
        self.borderMode: Literal['full', 'half', 'none'] = borderMode
        # 弹窗大小，支持: xs、sm、md、lg、xl、full
        self.pickerSize: Size = pickerSize

        for key, value in kwargs.items():
            self.__dict__[key] = value


class JSONSchema(FormBaseControlSchema):
    """
    JSONSchema

    这个组件可以基于 JSON Schema 生成表单项，方便对接类似 OpenAPI/Swagger Specification 的接口规范，可基于接口定义自动生成 amis 表单项。
    """

    def __init__(
            self,
            schema: any = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "json-schema"
        # json-schema 详情，支持关联上下文数据
        self.schema: any = schema

        for key, value in kwargs.items():
            self.__dict__[key] = value


class JSONSchemaEditor(FormBaseControlSchema):
    def __init__(
            self,
            definitions: Dict[str, object] = None,
            rootTypeMutable: bool = None,
            showRootInfo: bool = None,
            disabledTypes: List[str] = None,
            enableAdvancedSetting: bool = None,
            advancedSettings: Dict[str, object] = None,
            placeholder: str = None,
            mini: bool = None,
            **kwargs,
    ):
        super().__init__()
        self.type: str = "json-schema-editor"
        # 可以理解为类型模板，方便快速定义复杂类型
        self.definitions: Dict[str, object] = definitions
        # 顶层是否允许修改类型
        self.rootTypeMutable: bool = rootTypeMutable
        # 顶层类型信息是否隐藏
        self.showRootInfo: bool = showRootInfo
        # 禁用类型，默认禁用了 null 类型
        self.disabledTypes: List[str] = disabledTypes
        # 开启详情配置
        self.enableAdvancedSetting: bool = enableAdvancedSetting
        # /**
        #    * 自定义详情配置面板如：
        #    *
        #    * {
        #    *   boolean: [
        #    *      {type: "input-text", name: "aa", label: "AA" }
        #    *   ]
        #    * }
        #    *
        #    * 当配置布尔字段详情时，就会出现以上配置
        #    */
        self.advancedSettings: Dict[str, object] = advancedSettings
        # /**
        #    * 各属性输入控件的占位提示文本
        #    *
        #    * {
        #    *   key: "key placeholder",
        #    *   title: "title placeholder",
        #    *   description: "description placeholder",
        #    *   default: "default placeholder"
        #    * }
        #    *
        #    */
        self.placeholder: str = placeholder
        # 是否为迷你模式，会隐藏一些不必要的元素
        self.mini: bool = mini

        for key, value in kwargs.items():
            self.__dict__[key] = value
